import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class Harshi extends Applet{
	boolean c,r,l;
	public void init() {
		Panel j1 = new Panel();
		Button circle = new Button("Draw Circle");
		Button rect = new Button("Draw Rectangle");
		Button line = new Button("Draw Line");
		
		c=r=l=false;

		j1.add(circle);
		j1.add(rect);
		j1.add(line);
		
		circle.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if(c==true)c=false; else c=true;
				repaint();
			}
		});

		rect.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if(r==true)r=false; else r=true;
				repaint();
			}
		});

		line.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if(l==true)l=false; else l=true;
				repaint();
			}
		});
		
	
		add(j1);
	}
	public void paint(Graphics g) {
		if(c==true) {
			g.drawOval(50,50,250,250);
		}

		if(r==true) {
			g.drawRect(50,50,250,250);
		}

		if(l==true) {
			g.drawLine(50,50,300,300);
		}

	}
}
